package com.bw.module_member.viewmodel

import androidx.lifecycle.MutableLiveData
import com.bw.lib_common.vm.BaseViewModel
import com.bw.lib_common.vm.BaseViewModel2
import com.bw.lib_common.vm.BaseViewModel3
import com.bw.lib_http.OkHttpClientManager
import com.bw.lib_http.entity.MemberEntity
import com.bw.module_member.api.MemberApiService
import kotlinx.coroutines.launch


class MemberViewModel: BaseViewModel3() {
    val getMemberSuccess by lazy { MutableLiveData<MemberEntity>() }
    val apiService: MemberApiService = OkHttpClientManager.retrofitInstance.create(MemberApiService::class.java)

    fun MemberManage(userId:Int){
        executeNotResNetwork(
            { apiService.getMember(userId) },
            getMemberSuccess::postValue
        )
    }
}